/**
 * Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com).
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.springblade.modules.order.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;

import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import jakarta.validation.constraints.NotNull;
import org.springblade.core.mp.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import io.swagger.v3.oas.annotations.media.Schema;
import org.springblade.modules.commodity.entity.Commodity;

import java.io.Serial;
import java.util.Date;
import java.util.List;

/**
 * 订单表实体类
 *
 * @author Blade
 * @since 2024-09-02
 */
@Data
@TableName("yf_order")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "订单表")
public class Order extends BaseEntity {

    @Serial
	private static final long serialVersionUID = 1L;
    /**
     * 创建用户名
     */
    @Schema(description = "创建用户名")
    private String createUserName;
	/**
	 * 商品清单
	 */
	@TableField(value="commodity_list",typeHandler = JacksonTypeHandler.class)
	@NotNull(message = "商品信息不能为空")
	private List<Commodity> commodityList;


	/**
	 * 用户小程序openid
	 */
	private String wxOpenId;

	/**
	 * 商户订单号
	 */
	@NotNull(message = "商户订单号不能为空")
	private String outTradeNo;

	/**
	 * 支付情况 1已支付 2未支付 3退款 4取消
	 */
	private Integer payStatus;

	/**
	 * 立即付款
	 */
	private String payNonce;

	/**
	 * 交易id
	 */
	private String transactionId;

	/**
	 * 支付时间
	 */
	private String payTime;

	/**
	 * 核销状态 0待核销 1已核销 2已归还
	 */
	private Integer verifyStatus;

	/**
	 * 核销时间
	 */
	private Date verifyTime;

	/**
	 * 返回时间
	 */
	private Date returnTime;
	/**
	 * 订单类型 1买断 2租赁
	 */
	private Integer type;

	/**
	 * 下单手机号
	 */
	private String phone;
}
